evaluate right side first, then remember the result as the value on the left side
in case of fractions always round down


1) p.atk = (buffed) attack power + (63+Level)*(INT+2)/53 + gear bonus
	for units without helm (i.e. monster) INT is halved
	gear bonus:
		Lv/2+2 tech helm OR tech weapon


2) Sigmund bonus if equipped
	bonus = target's attack * 0.1875
	p.atk = p.atk + bonus

	
3) Deathbringer bonus if equipped
	bonus = min(255, x-distance)Ġ + min(255, y-distance)Ġ	//distance squared and capped; x/y-distance compares the top-left pixels of the involved sprites
	bonus = max(0, 8191 - bonus)/32
	p.atk = p.atk + bonus


4) Death Stroke bonus if equipped and user HP below 300
	p.atk = p.atk * 1.5


5) unless the target has a Trials Defense helm
	damage = p.atk - defense


6) for single target attack:
	damage = damage * 1.25


7) physical resistance/weakness
	x1.00 if equipped with Levatein tier weapon
	x1.50 damage for weakness
	x0.50 damage for resistance
	x0.25 damage for strong resistance
	x0.00 damage for immunity


8) elemental resistance/weakness based on active saber
	x1.50 damage for weakness
	x0.50 damage for resistance
	x0.25 damage for immunity


9) damage = damage * tech power factor
	tech power factor:
		Eruption Sword: +10
		Lv2 ST tech: +8
		Lv2 MT tech: +7
		Lv3 ST tech: +10
		Lv3 MT tech: +9


10) damage = damage / 6
	


11) power up/down buff on attacker
	damage = damage * 1.25 for buff
	damage = damage * 0.75 for debuff
	no change if both or neither


12) defense up/down buff on target
	damage = damage * 0.75 for buff
	damage = damage * 1.25 for debuff


13) element of saber matches element of day
	damage x1.125


14) target has leaf coat debuff and user fire saber
	damage x1.5
	remove leaf coat


15) difficulty factor
	varies by character and difficulty, compare to player/enemy strength in the README


16) damage degradation for targetting high level monster
	100% vs players
	100% vs enemies Lv1-10
	47.31% vs enemies Lv99


17) if muted
	damage x0.5


18-22) boss mechanics
	omitted because spoilers


23) cap at 999 damage